
package com.example.mobile2032021606168xmy0405homework;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private ImageView ivMainLine;
    private Button btnMainLine0101;
    private boolean lineStatus=false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        int[] lines = new int[6];
        lines[0]=R.drawable.line01_01;
        lines[1]=R.drawable.line01_02;
        lines[2]=R.drawable.line01_03;
        lines[3]=R.drawable.line01_04;
        lines[4]=R.drawable.line01_05;
        lines[5]=R.drawable.line01_06;

        btnMainLine0101.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ivMainLine.setImageResource(lines[1]);
                ivMainLine.setImageResource(lines[2]);
                ivMainLine.setImageResource(lines[3]);
                ivMainLine.setImageResource(lines[4]);
                ivMainLine.setImageResource(lines[5]);
                ivMainLine.setImageResource(lines[6]);
                lineStatus = true;
            }
        });

    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tv_main_title);
        ivMainLine = (ImageView) findViewById(R.id.iv_main_line);
        btnMainLine0101 = (Button) findViewById(R.id.btn_main_line01_01);
    }
}